package com.atguigu.daijia.driver.config;

import com.baidu.aip.face.AipFace;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AipFaceConfig {
    @Value("${baidu.ai.appId}")
    private String appId;

    @Value("${baidu.ai.apiKey}")
    private String apiKey;

    @Value("${baidu.ai.secretKey}")
    private String secretKey;

    @Bean
    public AipFace aipFace() {
        AipFace client = new AipFace(appId, apiKey, secretKey);
        client.setConnectionTimeoutInMillis(5000);  // 超时设置
        return client;
    }
}